package com.kingzoder.food.exception;


import com.kingzoder.food.common.AppHttpCode;
import lombok.Getter;
import lombok.Setter;

/**
 * @author 轩辕铮
 */
@Setter
@Getter
public class RRException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    private String msg;
    private int code = 500;

    public RRException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public RRException(String msg, Throwable e) {
        super(msg, e);
        this.msg = msg;
    }

    public RRException(String msg, int code) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }

    public RRException(String msg, int code, Throwable e) {
        super(msg, e);
        this.msg = msg;
        this.code = code;
    }

    public RRException(AppHttpCode resultCode) {
        super(resultCode.getMessage());
        this.msg = resultCode.getMessage();
        this.code = resultCode.getCode();
    }

}
